﻿import * as types from '../const/actionTypes.js'
import * as api from '../api.js'

export function navRequest(params){
	return function(dispatch){
		dispatch({type:types.NAV_REQUEST});
		api.nav_request(params).then((res)=>{
			console.log(res);
			dispatch({ type:types.NAV_SUCCESS, payload:{loading:false,data:res.data}});
		}).catch((err)=>{
			dispatch({ type:types.NAV_FAILURE });
		});
	}
}
export function tableTest_refresh(params){
	return function(dispatch){
		dispatch({ type:types.TABLETEST_REQUEST});
		api.tableTest_refresh(params).then((res)=>{
			console.log(res);
			dispatch({ type:types.TABLETEST_SUCCESS, payload:{loading:false,data:res.data.payload}});
		}).catch((err)=>{
			dispatch({ type:types.TABLETEST_FAILURE });
		});
	}
}

